<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app" v-on:click.once="hello">大
        <button v-on:click="num++">点赞</button>
        <button v-on:click="num--">取消</button>
        {{num}}
        <div @click.prevent.stop="hello">小</div>
    </div>
    <script src="../node_modules/vue/dist/vue.js"></script>
    <script>
        new Vue({
            el: "#app",
            data: {
                num: 1
            },
            methods: {
                cancel() {
                    num--;
                },
                hello() {
                    alert("点击了");
                }
            }
        });
    </script>
</body>

</html>